// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.modules.dao.impl;

import com.liuxinlong.modules.dao.InventoryDao;
import com.liuxinlong.modules.entity.Inventory;
import com.liuxinlong.modules.mapper.InventoryMapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 类描述
 * <p>
 * 此类关联设计的功能
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2022年5月20日
 */
@Service
public class InventoryDaoImpl extends ServiceImpl<InventoryMapper, Inventory> implements InventoryDao {
	@Override
	public List<Inventory> pageInventoryList(Map<String, Object> queryParam) {
		return baseMapper.pageInventoryList(queryParam);
	}

	@Override
	public int getInventoryCount(Map<String, Object> queryParam) {
		return baseMapper.getInventoryCount(queryParam);
	}

	@Override
	public void addInventory(Inventory material) {
		baseMapper.insert(material);
	}

	@Override
	public void updateInventory(Inventory material) {
		baseMapper.updateById(material);
	}

	@Override
	public void deleteInventory(String id) {
		baseMapper.deleteById(id);
	}

	@Override
	public  List<Inventory> getInventoryList(Map<String, Object> queryParam) {
		return baseMapper.getInventoryList(queryParam);
	}

	@Override
	public void batchUpdateInventoryStatus(List<String> targetNoList, String targetStatus) {
		baseMapper.batchUpdateInventoryStatus(targetNoList, targetStatus);
	}

	@Override
	public Inventory selectOneByParam(String sn, String purchaseTime) {
		return baseMapper.selectOneByParam(sn,purchaseTime);
	}

	@Override
	public List<Inventory> queryAvailableInfo() {
		return baseMapper.queryAvailableInfo();
	}

	@Override
	public void batchUpdateLeftNum(List<String> targetList) {
		baseMapper.batchUpdateLeftNum(targetList);
	}

}
